package net.melon.logger.inst.struts2;

import java.util.Date;

import javax.annotation.Resource;
import javax.inject.Inject;

import net.esj.basic.plugins.view.FacadeAware;
import net.esj.basic.view.PageAction;
import net.melon.logger.manage.LoggerManage;
import net.melon.logger.manage.LoggerService;
import net.melon.logger.pojo.Logger;
import net.melon.logger.pojo.LoggerMethod;

public class LoggerAction extends PageAction<Logger, Logger> implements FacadeAware{
	
	private String template;
	private String theme;
	private String namespace;
	
	private String keywords;
	private String opName;
	private Date startDate;
	private Date endDate;
	private String methodId;
	
	private LoggerService loggerService;
	
	@SuppressWarnings("unchecked")
	@Override
	protected void doQueryPage() {
		pagination = loggerService.pageLogger(pagination, opName, new LoggerMethod(methodId), keywords, startDate, endDate);
	}
	
	public Logger getEntity(){
		return entity;
	}
	
	public void setEntity(Logger entity){
		this.entity = entity;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getMethodId() {
		return methodId;
	}

	public void setMethodId(String methodId) {
		this.methodId = methodId;
	}

	public String getOpName() {
		return opName;
	}

	public void setOpName(String opName) {
		this.opName = opName;
	}

	public String getTemplate() {
		return template;
	}

	public void setTemplate(String template) {
		this.template = template;
	}

	public String getTheme() {
		return theme;
	}

	public void setTheme(String theme) {
		this.theme = theme;
	}

	public String getNamespace() {
		return namespace;
	}

	public void setNamespace(String namespace) {
		this.namespace = namespace;
	}

	@Inject
	public void setLoggerService(LoggerService loggerService) {
		this.loggerService = loggerService;
	}
	
}
